define(function(require, exports, module) {
    var ALL = require("../../common/all"),
        CONFIG = ALL.CONFIG,
        METHOD = ALL.METHOD,
        Dialog = ALL.Dialog,
        Init = ALL.Init;

    var _Dialog = new Dialog({
        title : "提示",
        content : "<p>确定是否提交？</p>",
        text4Btn: ["确定", "取消"],
        class4Btn: ["", "line"]
    });


    var _vm = Init.initVue({
        data : {
            check : {},
            res: {
                pnr_no : "",
                col_id : "",
                r_fee : "",
                user_name : "",
            }
        },
        methods: {
            getInfoCallback : function(obj) {
                if (obj) {
                    this.res.user_name = obj.name;
                } else {
                    this.res.user_name = "";
                }
            },
            submit : function() {
                this.check.$valid();

                if (!this.check.flag) { return; }

                _Dialog.showUI(function(i) {
                    if (i == 0) {
                        METHOD.loading.show();
                        METHOD.ajax("user/asset/add_main_force",{ data: JSON.stringify(_vm.res)},{type : 'post'}).done(function(){
                            METHOD.loading.hide();
                            METHOD.alert("操作成功").done(function(){
                                window.location.href = "../user/main.html";
                            });
                        }).fail(function(){
                            METHOD.loading.hide();
                        });
                    }
                    this.hideUI();
                });
            }
        }
    });

});

